package com.cy.pj.sys.web.config;

import com.cy.pj.sys.web.interceptor.TimeAccessInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @DATE: 2021/3/12 9:16
 * @Author: LuckyH
 */

// 公告配置类 实现WebMvcConfigurer 建议加个注解Configuration

@Configuration
public class SpringWebConfig implements WebMvcConfigurer {

    /**
     * 注册拦截器
     * @param registry
     */

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 拦截对象下所有的请求
        registry.addInterceptor(new TimeAccessInterceptor())
                .addPathPatterns("/notice/*");
    }
}




